package com.example.dell.fastshopping.user.entity;

import java.math.BigDecimal;

public class Balance {
    //种类(1消耗/2体现/3加价/4返利/5竞拍/6奖励/7任务)
    private Integer type;

    //交易后费用
    private BigDecimal cost;

    //用户id
    private Integer userId;

    //创建时间
    private Long createTime;

    //来源
    private String channelName;

    //交易额度
    private BigDecimal limitno;

    public void setType(Integer type) {
        this.type = type;
    }

    public void setCost(BigDecimal cost) {
        this.cost = cost;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public void setLimitno(BigDecimal limitno) {
        this.limitno = limitno;
    }

    public Integer getType() {
        return type;
    }

    public BigDecimal getCost() {
        return cost;
    }

    public Integer getUserId() {
        return userId;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public String getChannelName() {
        return channelName;
    }

    public BigDecimal getLimitno() {
        return limitno;
    }

    public String getLimitnoString() {
        if (limitno == null) {
            return "0.00";
        }
        return limitno.doubleValue() + "";
    }

    public String getTypeString() {
        //种类(1消耗/2体现/3加价/4返利/5竞拍/6奖励/7任务)
        String s = "";
        switch (this.type) {
            case 1:
                s = "消耗";
                break;
            case 2:
                s = "体现";
                break;
            case 3:
                s = "加价";
                break;
            case 4:
                s = "返利";
                break;
            case 5:
                s = "竞拍";
                break;
            case 6:
                s = "奖励";
                break;
            case 7:
                s = "任务";
                break;

        }
        return s;
    }
}
